<%-- 
    Document   : index
    Created on : Oct 10, 2013, 4:26:56 PM
    Author     : hue
--%>
<%@page language="java" extends="g5.test.TestServlet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<script language="JavaScript" src="scripts/table.js"></script>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Test Page</title>
        <script language = "JavaScript">
            <!--
            function init() {
                initPage(<%=request.getAttribute("page")%>);
            }
            
            function initPage(jsObj) {
                var isEditMode = true;
                var iLength = jsObj.hBoxes.length;
                var html = "";
                for(var i=0; i<iLength; i++) {
                    var str = "";
                    var box = jsObj.hBoxes[i];
                    if(box.both != null) {
                        str += createTag("td", "colspan=2", createSection(box.both, isEditMode));
                    }
                    else {
                        if(box.left != null) {
                            str += createTag("td", "", createSection(box.left, isEditMode));
                        }
                        if(box.right != null) {
                            str += createTag("td", "", createSection(box.right, isEditMode));
                        }
                    }
                    if(str != "") {
                        html += createTag("tr", "", str);
                    }
                }
                html = createTag("table", "border='0' width='100%' cellspacing=4", html);
                document.getElementById("FORM_DIV").innerHTML = html;
            }
            -->
        </script>
    </head>
    <body onload="init()">
        <div id="FORM_DIV"></div>
    </body>
</html>
